package com.vteba.utils.common;

import java.net.URL;
import java.security.CodeSource;
import java.security.ProtectionDomain;

/**
 * 获取类所在的路径
 * 
 * @author yinlei
 * @see
 * @date 2015-6-21
 */
public class PathUtils {

	public static String getPath(Class<?> clazz) {
		ProtectionDomain domain = clazz.getProtectionDomain();
		CodeSource codeSource = domain.getCodeSource();
		URL location = codeSource.getLocation();
		String path = location.getPath();
		return path;
	}
}
